﻿using System.ComponentModel;
using SweeperPrototype.Business.Fields;
using SweeperPrototype.Objects;

namespace SweeperPrototype.GUI.ExposureMappings
{
    public class ExposureMappingViewModel : BaseVM
    {
        public static readonly PropertyChangedEventArgs ARGS_QUANTITY = new PropertyChangedEventArgs("Quantity");
        public static readonly PropertyChangedEventArgs ARGS_ISSELECTED = new PropertyChangedEventArgs("IsSelected");

        private readonly ExposureMappingSubscription m_CoreExposureMapping;

        public ExposureMappingViewModel(ExposureMappingSubscription core_exposure_mapping)
        {
            m_CoreExposureMapping = core_exposure_mapping;
            // TODO: link to multiplier changed.
        }

        public ExposureMappingSubscription CoreExposureMapping
        {
            get { return m_CoreExposureMapping; }
        }

        public ExposureRIC ExposureRIC
        {
            get { return m_CoreExposureMapping.ExposureRIC; }
        }

        public EffectiveRIC EffectiveRIC
        {
            get { return m_CoreExposureMapping.EffectiveRIC; }
        }

        public Multiplier Multiplier
        {
            get { return m_CoreExposureMapping.Multiplier; }
        }


        private bool m_IsSelected;

        public bool IsSelected
        {
            get { return m_IsSelected; }
            set
            {
                if (m_IsSelected == value) return;

                m_IsSelected = value;
                FirePropertyChanged(ARGS_ISSELECTED);
            }
        }
    }
}